/*============================
*	File Name: Pet.c
*	Created Date: 12/16/2021 5:18:47 PM
*	Last Modified Date:12/17/2021 11:15:47 AM
*	Author: mistgc
*	Email: georgecai0908@outlook.com
============================*/
#include "Pet.h"
#include <assert.h>
#include <stdio.h>

//Pet的虚函数
//static void Pet_eat_(Pet * const me);
void Pet_eat_(Pet const * const me);

//构造函数
void Pet_ctor(Pet * const me, char *name){
	static PetVTBL const vtbl = {
		&Pet_eat_
	};
    me->name = name;
}
//Pet数据操作函数
void Pet_rename(Pet * const me, char *new_name){
    me->name = new_name;
}
//Pet接口函数
char *Pet_getName(Pet const * const me){
    return me->name;
}
//Pet的虚函数
void Pet_eat_(Pet const * const me){
	//assert(0);	//可以看作纯虚函数
	printf("Pet is eating...");
}
